package interpreter.bytecodes;

import interpreter.VirtualMachine;
import java.util.NoSuchElementException;
import java.util.Vector;

/**
 *
 * @author Kristofer Selbekk
 */
public class WriteByteCode extends ByteCode {

    /**
     * Initializes the byte code with no arguments, that is, do nothing
     */
    public void init( Vector<String> args ) {
    
    }

    /**
     * Action: Writes the value on top of the stack to output.
     *
     * Note: Does not remove the element from the stack
     *
     * @param rt the Virtual Machine reference
     */
    public void exec( VirtualMachine rt ) {
        System.out.println( rt.getTopOfStack() );
        //System.out.println( "WRITE SAYS: "+ rt.getTopOfStack() ); // Debug printout
    }

    public Object getArgs() {
        return null;
    }
}